#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
bool prime(int x, int y)
{
    for (int i = 2; i < x; i++)
    {
        if (x % i == 0)
        {
            return false;
        }
    }
    for (int i = 2; i < y; i++)
    {
        if (y % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    int p1 = 0, p2 = 0;
    int n = 20;
    //cin >> n;
    int i = 2;
    int j = n - 2;
    int count = 1000;
    int new_count = 0;
    for (; i <= j; i++, j--)
    {
        if (prime(i, j))
        {
            new_count = j - i;
        }
        if (new_count < count)
        {
            count = new_count;
            p1 = i;
            p2 = j;
        }
    }
    cout << p1 << endl;
    cout << p2 << endl;
    return 0;
}